<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/XGame_template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<?php
include('lock.php');

if($_SERVER["REQUEST_METHOD"] == "POST")
{
	if($_POST['name'] && $_POST['address'] && $_POST['number'])
	{
		
		$myusername=addslashes($_POST['name']);			
		$myaddress=addslashes($_POST['address']);
		$mynumber=addslashes($_POST['number']);	
		$sql="UPDATE user SET user_name='$myusername', user_address='$myaddress', user_contact='$mynumber' WHERE user_ID='$login_session'";

		mysql_query($sql);
	}
}

$sql = "SELECT * FROM user Where user_ID = '$login_session'";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
	
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>XGame</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->

<!-- InstanceEndEditable -->
<link type="text/css" rel="stylesheet" href="CSS/css.css" />
</head>

<body>
<div id="container">

<div id="wrapper">

<div id="banner">
<!-- InstanceBeginEditable name="TopLink" -->
<?php
$q = "SELECT user_name FROM user where user_ID = '$login_session'";
$result=mysql_query($q);
$data_fetch=mysql_fetch_array($result);
?>
<ul class="topLink">
<li> Welcome, <a href="UserProfile.php"> <?php echo $data_fetch['user_name']; ?> </a> </li>
<li> <a href="Wishlist.php"> Wishlist </a> &nbsp; | &nbsp;<a href="userShoppingCart.php"> Cart </a> </li>
<li> <a href="Logout.php"> Logout </a> </li>
</ul>
<!-- InstanceEndEditable -->
<img src="Assets/XGame.png" alt="XGame" />
</div>

<div id="menu">
<ul class="nav">
<form method="post" action="search_result.php">
<li> <span> <input type="text" placeholder="Search Keyword" name="search" />
&nbsp; <input type="submit" name="Search" value="Search" /> </span>
</li>
</form>
<li> <a href="Home.php"> Home </a> </li>
<li> <a href="ListOfNews.php"> News </a> </li>
<li> <a href="Games.php"> Games </a> </li>
<li> <a href="FAQ.php"> FAQ </a> </li>
<li> <a href="ContactUs.php"> Contact Us </a> </li>
</ul>

</div>

<div id="main">
<!-- InstanceBeginEditable name="Main" -->
<form id="registerUpdate" name="registerUpdate" method="POST">
<h3> User Particular </h3>

<label>Name</label>
<input type="text" name="name" value="<?php echo $row["user_name"]; ?>"/>

<label>Password</label>
<input type="password" name="password" value="<?php echo $row["user_password"];?>" disabled="true"/>
<p id="changePass"> &nbsp; <a href="ChangePassword.php"> Change </a> </p>

<label>Address</label>
<input type="text" name="address" value="<?php echo $row["user_address"]; ?>"/>

<label>Contact Number</label>
<input type="text" name="number" value="<?php echo $row["user_contact"]; ?>"/>

<button type="submit">Update</button>

</form>
<!-- InstanceEndEditable -->
</div>

<div id="footer">
<p align="center"> &copy; &nbsp; 2012 XGame </p>
</div>

</div>

</div>

</body>
<!-- InstanceEnd --></html>
